import app from '@/app'
import { appendLocale } from '@/lang'
import locale from './locale'
import routes from '../routes'

// 引入 Style
import './style/app.scss'

// 注册进入事件
app.plugin.register('main', () => {
  // 初始化模型
  import('./model/index').then(model => model.default.get())
  import('./model/tax').then(model => model.default.get())
  import('./model/pay').then(model => model.default.get())
  import('./model/template').then(model => model.default.get())
})

// 加载语言包
appendLocale('Config', locale)

// 创建插件路由
routes({
  path: 'config',
  component: () => import('./main.vue'),
  children: [
    {
      path: '',
      component: () => import('./view/index.vue')
    },
    {
      path: 'tax',
      component: () => import('./view/tax')
    },
    {
      path: 'pay',
      component: () => import('./view/pay')
    },
    {
      path: 'template',
      component: () => import('./view/template')
    }
  ]
})
